package org.darkforest.common.services;

import org.darkforest.model.PMansong;
import org.darkforest.vo.AjaxReturnData;

import java.util.List;

/**
 * Created by Administrator on 2016/1/12.
 */
public interface MansongService {


    int deleteByPrimaryKey(Integer mansongId);

    int insert(PMansong record);

    int insertSelective(PMansong record);

    PMansong selectByPrimaryKey(Integer mansongId);

    int updateByPrimaryKeySelective(PMansong record);

    int updateByPrimaryKey(PMansong record);

    /**
     * 根据传入的查询条件查询满即送活动列表
     * @param record
     * @return List<PMansong>
     */
    List<PMansong> findListByCondition(PMansong record);


    /**
     * 根据传入的查询条件查询满即送活动列表以及活动对应的满减规则
     * @param record
     * @return List<PMansong>
     */
    List<PMansong> findListWithRuleByCondition(PMansong record);

    /**
     * 根据满送Id查询满送活动以及满送活动对应规则
     * @param mansongId
     * @return PMansong
     */
    PMansong getPMansongWithRules(Integer mansongId);

    /**
     * 添加满送活动 ajax返回
     * @param pMansong
     * @param url
     * @return
     */
    AjaxReturnData addManSongActive(PMansong pMansong, String url) throws Exception;


    /**
     * 删除满送活动 ajax返回
     * @param mansongId
     * @param url
     * @return AjaxReturnData
     */
    AjaxReturnData deleMansongActive(Integer mansongId, String url) throws Exception;

    /**
     * 取消满送活动
     * @param mansongId
     * @param state
     * @param url
     * @return
     */
    AjaxReturnData updateMansong(Integer mansongId, byte state, String url) throws Exception;
}
